﻿using System;
using System.Collections.Generic;
using System.Text;

using E.Model;
using E.DAL;

namespace E.BLL
{
    public class ClassBLL
    {
        private ClassDAL dal;

        public ClassBLL()
        {
            dal = new ClassDAL();
        }

      
        /// <summary>
        /// 查找班级
        /// </summary>
        /// <param name="model"></param>
        /// <param name="pageSize"></param>
        /// <param name="pageIndex"></param>
        /// <returns></returns>
        public ClassListModel SearchClassByCondition(ClassModel model, int pageSize, int pageIndex,bool bIsSignUp)
        {
            return dal.SearchClassByCondition(model, pageSize, pageIndex,bIsSignUp);
        }
        /// <summary>
        /// 查找班级（课程报名）
        /// </summary>
        /// <param name="model"></param>
        /// <param name="pageSize"></param>
        /// <param name="pageIndex"></param>
        /// <returns></returns>
        public ClassListModel SearchClassByRegister(ClassModel model, int pageSize, int pageIndex)
        {
            return dal.SearchClassByRegister(model, pageSize, pageIndex);
        }

        /// <summary>
        /// 报名选择课程
        /// </summary>
        /// <param name="userid"></param>
        /// <param name="classid"></param>
        /// <param name="courseRelationID"></param>
        /// <returns></returns>
        public int SignUp(int userid, int classid, int courseRelationID, int signupTypeid)
        {
            return dal.SignUp(userid, classid, courseRelationID,signupTypeid);
        }

        /// <summary>
        /// 添加班级
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public int AddClass(ClassModel model)
        {
            return dal.AddClass(model);
        }

        /// <summary>
        /// 更新班级信息
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public int UpdateClass(ClassModel model)
        {
            return dal.UpdateClass(model);
        }

        /// <summary>
        /// 获取班级信息
        /// </summary>
        /// <param name="classid"></param>
        /// <returns></returns>
        public ClassModel GetClassInfo(int classid)
        {
            return dal.GetClassInfo(classid);
        }

        /// <summary>
        /// 获取班级学员列表
        /// </summary>
        /// <param name="classid"></param>
        /// <returns></returns>
        public IList<UserListModel> GetUserListInClass(int classid)
        {
            return dal.GetUserListInClass(classid);
        }
        /// <summary>
        /// 获取学员姓名
        /// </summary>
        /// <param name="classid"></param>
        /// <returns></returns>
        public UserListModel GetUserNameByUserID(string userID)
        {
            return dal.GetUserNameByUserID(userID);
        }

        #region 内训

        /// <summary>
        /// 获取内训班级
        /// </summary>
        /// <param name="searchModel"></param>
        /// <param name="pageSize"></param>
        /// <param name="pageIndex"></param>
        /// <returns></returns>
        public InternalClassListModel GetInternalClassListByCondition(InternalClassSearchModel searchModel, int pageSize, int pageIndex)
        {
            return dal.GetInternalClassListByCondition(searchModel, pageSize, pageIndex,false);
        }
        /// <summary>
        /// 获取报名审核班级
        /// </summary>
        /// <param name="searchModel"></param>
        /// <param name="pageSize"></param>
        /// <param name="pageIndex"></param>
        /// <returns></returns>
        public InternalClassListModel GetInternalClassReDealListByCondition(InternalClassSearchModel searchModel, int pageSize, int pageIndex,bool bIsDeal)
        {
            return dal.GetInternalClassListByCondition(searchModel, pageSize, pageIndex,bIsDeal);
        }
        /// <summary>
        /// 获取内训班级信息
        /// </summary>
        /// <param name="classid"></param>
        /// <returns></returns>
        public InternalClassModel GetInternalClassInfoById(int classid)
        {
            return dal.GetInternalClassInfoById(classid);
        }

        /// <summary>
        /// 获取内训班级学员列表
        /// </summary>
        /// <param name="classid"></param>
        /// <returns></returns>
        public IList<UserListModel> GetUserListInInternalClass(int classid)
        {
            return dal.GetUserListInInternalClass(classid);
        }

        /// <summary>
        /// 添加内训班级
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public int AddInternalClass(InternalClassModel model)
        {
            return dal.AddInternalClass(model);
        }
        /// <summary>
        /// 添加报名审核的学生（内训）
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public int AddSignUpStudents(InternalClassModel model)
        {
            return dal.AddSignUpStudents(model);
        }
        /// <summary>
        /// 添加报名审核的学生(外训)
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public int AddSignUpPublicStudents(ClassModel model)
        {
            return dal.AddSignUpPublicStudents(model);
        }
        /// <summary>
        /// 更新内训班级
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public int UpdateInternalClass(InternalClassModel model)
        {
            return dal.UpdateInternalClass(model);
        }

        /// <summary>
        /// 报名
        /// </summary>
        /// <param name="userid"></param>
        /// <param name="classid"></param>
        /// <param name="courseid"></param>
        /// <param name="projectid"></param>
        /// <returns></returns>
        public int SignUpInternal(int userid, int classid, int courseid, int projectid, int signuptypeid)
        {
            return dal.SignUpInternal(userid, classid, courseid, projectid, signuptypeid);
        }

        /// <summary>
        /// 获取用户报名班级
        /// </summary>
        /// <param name="userid"></param>
        /// <param name="courseid"></param>
        /// <returns></returns>
        public IList<InternalClassModel> GetUserSignedInternalClassList(int userid, int courseid)
        {
            return dal.GetUserSignedInternalClassList(userid, courseid);
        }

        /// <summary>
        /// 获取内训班级用户数量
        /// </summary>
        /// <param name="classid"></param>
        /// <returns></returns>
        public int GetInternalClassUserCount(int classid)
        {
            return dal.GetInternalClassUserCount(classid);
        }

        #endregion

        #region 内训 公共课

        /// <summary>
        /// 获取内训班级
        /// </summary>
        /// <param name="searchModel"></param>
        /// <param name="pageSize"></param>
        /// <param name="pageIndex"></param>
        /// <returns></returns>
        public InternalPublicClassListModel GetInternalPublicClassListByCondition(InternalPublicClassSearchModel searchModel, int pageSize, int pageIndex)
        {
            return dal.GetInternalPublicClassListByCondition(searchModel, pageSize, pageIndex);
        }

        /// <summary>
        /// 获取内训班级信息
        /// </summary>
        /// <param name="classid"></param>
        /// <returns></returns>
        public InternalPublicClassModel GetInternalPublicClassInfoById(int classid)
        {
            return dal.GetInternalPublicClassInfoById(classid);
        }

        /// <summary>
        /// 获取内训班级学员列表
        /// </summary>
        /// <param name="classid"></param>
        /// <returns></returns>
        public IList<UserListModel> GetUserListInInternalPublicClass(int classid)
        {
            return dal.GetUserListInInternalPublicClass(classid);
        }

        /// <summary>
        /// 添加内训班级
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public int AddInternalPublicClass(InternalPublicClassModel model)
        {
            return dal.AddInternalPublicClass(model);
        }

        /// <summary>
        /// 更新内训班级
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public int UpdateInternalPublicClass(InternalPublicClassModel model)
        {
            return dal.UpdateInternalPublicClass(model);
        }

        /// <summary>
        /// 报名
        /// </summary>
        /// <param name="userid"></param>
        /// <param name="classid"></param>
        /// <param name="courseid"></param>
        /// <param name="projectid"></param>
        /// <returns></returns>
        public int SignUpInternalPublic(int userid, int classid, int courseid, int projectid)
        {
            return dal.SignUpInternalPublic(userid, classid, courseid, projectid);
        }

        /// <summary>
        /// 获取用户报名班级
        /// </summary>
        /// <param name="userid"></param>
        /// <param name="courseid"></param>
        /// <returns></returns>
        public IList<InternalPublicClassModel> GetUserSignedInternalPublicClassList(int userid, int courseid)
        {
            return dal.GetUserSignedInternalPublicClassList(userid, courseid);
        }

        /// <summary>
        /// 获取内训班级用户数量
        /// </summary>
        /// <param name="classid"></param>
        /// <returns></returns>
        public int GetInternalPublicClassUserCount(int classid)
        {
            return dal.GetInternalPublicClassUserCount(classid);
        }

        #endregion
        
    }
}
